// Decompiled by:       Fernflower v0.6
// Date:                28.11.2010 03:55:55
// Copyright:           2008-2009, Stiver
// Home page:           http://www.reversed-java.com

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;

public class HBThread implements Runnable {

   private boolean KKLI = false;
   private GUI SEVERE;
   private long connect;
   private long currentTimeMillis;


   public HBThread(GUI var1) {
      this.SEVERE = var1;
      this.disconnect();
   }

   public final void run() {
      for(; this.KKLI; getInputStream(10000)) {
         if(this.SEVERE()) {
            this.KKLI();
         }

         if(this.connect()) {
            this.currentTimeMillis();
         }
      }

   }

   private void KKLI() {
      try {
         URL var1 = new URL("http://www.mccheat.net/mccheat/heartbeat.php");
         HttpURLConnection var2 = (HttpURLConnection)var1.openConnection();
         var2.connect();
         var2.getInputStream();
         var2.disconnect();
         this.connect = System.currentTimeMillis();
         System.out.println("Sent..");
      } catch (IOException var3) {
         Logger.getLogger(HBThread.class.getName()).log(Level.SEVERE, (String)null, var3);
      }

   }

   private boolean SEVERE() {
      return System.currentTimeMillis() - this.connect >= 300000L;
   }

   private boolean connect() {
      return System.currentTimeMillis() - this.currentTimeMillis >= 60000L;
   }

   private void currentTimeMillis() {
      try {
         URL var1 = new URL("http://www.mccheat.net/mccheat/users.php");
         BufferedReader var2 = new BufferedReader(new InputStreamReader(var1.openStream()));
         String var3 = var2.readLine().trim();
         this.SEVERE.I.setText(var3);
         this.currentTimeMillis = System.currentTimeMillis();
      } catch (IOException var4) {
         Logger.getLogger(HBThread.class.getName()).log(Level.SEVERE, (String)null, var4);
      }

   }

   private void disconnect() {
      this.KKLI = true;
      (new Thread(this)).start();
   }

   private static void getInputStream(int var0) {
      try {
         Thread.sleep((long)var0);
      } catch (InterruptedException var2) {
         ;
      }

   }
}
